/*
 * Copyright (C) 2014 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 * Purpose : Definition of OMCI utilities APIs
 *
 * Feature : The file includes the following modules and sub-modules
 *           (1) OMCI voice utilities APIs
 */

#include "app_basic.h"
void voice_service_profile(UINT16 chid, UINT16 VoiceServiceProfilePointer){
	// Voice service profile 9.9.6
	MIB_TABLE_VOICESERVICEPROFILE_T             tmpMibVoiceServiceProfile, *pMibVoiceServiceProfile=NULL;
	
	tmpMibVoiceServiceProfile.EntityId = VoiceServiceProfilePointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_VOICESERVICEPROFILE_INDEX , &tmpMibVoiceServiceProfile, &pMibVoiceServiceProfile)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"RTP profle data not found %u\n" , tmpMibVoiceServiceProfile.EntityId);
	}else{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Voice service profile Entry found, EntityId=%u\n" , tmpMibVoiceServiceProfile.EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"AnnouncementType=%u\n" , pMibVoiceServiceProfile->AnnouncementType);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"JitterTarget=%u\n" , pMibVoiceServiceProfile->JitterTarget);
		VOICE_WRAPPER(omci_voice_jitter_set, chid, OMCI_VOIP_JITTER_TARGET,pMibVoiceServiceProfile->JitterTarget);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"JitterBufferMax=%u\n" , pMibVoiceServiceProfile->JitterBufferMax);
		VOICE_WRAPPER(omci_voice_jitter_set, chid, OMCI_VOIP_JITTER_MAX,pMibVoiceServiceProfile->JitterBufferMax);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"EchoCancelInd=%u\n" , pMibVoiceServiceProfile->EchoCancelInd);
		VOICE_WRAPPER(omci_voice_echo_cancel_ind_set, chid, pMibVoiceServiceProfile->EchoCancelInd);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PSTNProtocolVariant=%u\n" , pMibVoiceServiceProfile->PSTNProtocolVariant);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"HookFlashMinimumTime=%u\n" , pMibVoiceServiceProfile->HookFlashMinimumTime);
		VOICE_WRAPPER(omci_voice_hook_flash_time_set, chid, OMCI_VOIP_HOOK_TIME_MIN, pMibVoiceServiceProfile->HookFlashMinimumTime);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"HookFlashMinimumTime=%u\n" , pMibVoiceServiceProfile->HookFlashMaximumTime);
		VOICE_WRAPPER(omci_voice_hook_flash_time_set, chid, OMCI_VOIP_HOOK_TIME_MAX, pMibVoiceServiceProfile->HookFlashMaximumTime);
	}
}
void rtp_profile_data(UINT16 chid, UINT16 RTPProfilePointer){
	// RTP profile data 9.9.7
	MIB_TABLE_RTPPROFILEDATA_T                  tmpMibRtpProfileData, *pMibRtpProfileData=NULL;

	tmpMibRtpProfileData.EntityId = RTPProfilePointer;
	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"RTP profle data Entry found. EntityId=%u\n" , tmpMibRtpProfileData.EntityId);
	
	if (FALSE == mib_FindEntry(MIB_TABLE_RTPPROFILEDATA_INDEX , &tmpMibRtpProfileData, &pMibRtpProfileData)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"RTP profle data not found %u\n" , tmpMibRtpProfileData.EntityId);
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"LocalPortMin=%u\n" , pMibRtpProfileData->LocalPortMin);
		VOICE_WRAPPER(omci_voice_min_local_port_set, chid, pMibRtpProfileData->LocalPortMin);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"LocalPortMax=%u\n" , pMibRtpProfileData->LocalPortMax);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DSCPMark=%u\n" , pMibRtpProfileData->DSCPMark);
		VOICE_WRAPPER(omci_voice_dscp_mark_set, pMibRtpProfileData->DSCPMark);
		// RFC4733
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PiggybackEvents=%u\n" , pMibRtpProfileData->PiggybackEvents);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"ToneEvents=%u\n" , pMibRtpProfileData->ToneEvents);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DTMFEvents=%u\n" , pMibRtpProfileData->DTMFEvents);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CASEvents=%u\n" , pMibRtpProfileData->CASEvents);
	}	
}
void voip_media_profile(UINT16 chid, UINT16 VOIPMediaProfilePointer){
	// VoIP media profile 9.9.5
	MIB_TABLE_VOIPMEDIAPROFILE_T                tmpMibVoIPMediaProfile, *pMibVoIPMediaProfile=NULL;
	UINT8 order_size = 12;

	tmpMibVoIPMediaProfile.EntityId = VOIPMediaProfilePointer;
		
	if (FALSE == mib_FindEntry(MIB_TABLE_VOIPMEDIAPROFILE_INDEX , &tmpMibVoIPMediaProfile, &pMibVoIPMediaProfile)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoIP media profile not found %u\n" , tmpMibVoIPMediaProfile.EntityId);
	}
	else{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"FaxMode=%u\n" , pMibVoIPMediaProfile->FaxMode);
		VOICE_WRAPPER(omci_voice_fax_mode_set, chid, pMibVoIPMediaProfile->FaxMode);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"OOBDTMF=%u\n" , pMibVoIPMediaProfile->OOBDTMF);
		VOICE_WRAPPER(omci_voice_oob_dtmf_set, chid, pMibVoIPMediaProfile->OOBDTMF);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CodecSelection1stOrder=%u\n"        , pMibVoIPMediaProfile->CodecSelection1stOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PacketPeriodSelection1stOrder=%u\n" , pMibVoIPMediaProfile->PacketPeriodSelection1stOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SilenceSuppression1stOrder=%u\n"    , pMibVoIPMediaProfile->SilenceSuppression1stOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CodecSelection2ndOrder=%u\n"        , pMibVoIPMediaProfile->CodecSelection2ndOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PacketPeriodSelection2ndOrder=%u\n" , pMibVoIPMediaProfile->PacketPeriodSelection2ndOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SilenceSuppression2ndOrder=%u\n"    , pMibVoIPMediaProfile->SilenceSuppression2ndOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CodecSelection3rdOrder=%u\n"        , pMibVoIPMediaProfile->CodecSelection3rdOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PacketPeriodSelection3rdOrder=%u\n" , pMibVoIPMediaProfile->PacketPeriodSelection3rdOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SilenceSuppression3rdOrder=%u\n"    , pMibVoIPMediaProfile->SilenceSuppression3rdOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CodecSelection4thOrder=%u\n"        , pMibVoIPMediaProfile->CodecSelection4thOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PacketPeriodSelection4thOrder=%u\n" , pMibVoIPMediaProfile->PacketPeriodSelection4thOrder);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SilenceSuppression4thOrder=%u\n"    , pMibVoIPMediaProfile->SilenceSuppression4thOrder);
		UINT8 *p_addr_base = (UINT8 *)pMibVoIPMediaProfile;
		VOICE_WRAPPER(omci_voice_codec_sel_order_set_all, chid, (p_addr_base + 5), order_size);
 		rtp_profile_data(chid, pMibVoIPMediaProfile->RTPProfilePointer);
		voice_service_profile(chid, pMibVoIPMediaProfile->VoiceServiceProfilePointer);	
	}
}
void network_dial_plan(UINT16 chid, UINT16 NetworkDialPlanPointer){
	// Network dial plan table 9.9.10
	MIB_TABLE_NETWORKDIALPLANTABLE_T            tmpMibDialPlanTbl, *pMibDialPlanTbl = NULL;	
	dpTableEntry_t              *pDialPlanTblEntry = NULL;
	int entryID=0;	

	tmpMibDialPlanTbl.EntityId = NetworkDialPlanPointer;
	if (mib_FindEntry(MIB_TABLE_NETWORKDIALPLANTABLE_INDEX, &tmpMibDialPlanTbl, &pMibDialPlanTbl))
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network Dial Plan entry found\n");
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"EntityId=%d curDpTableEntryCnt=%u\n" , pMibDialPlanTbl->EntityId, pMibDialPlanTbl->DialPlanNumber);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CriticalDialTimeout=%u\n" ,  pMibDialPlanTbl->CriticalDialTimeout);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PartialDialTimeout=%u\n" ,  pMibDialPlanTbl->PartialDialTimeout);

		//VOICE_WRAPPER(omci_voice_critical_dial_timeout_set, chid,  pMibDialPlanTbl->CriticalDialTimeout);
		//VOICE_WRAPPER(omci_voice_partial_dial_timeout_set, chid,  pMibDialPlanTbl->PartialDialTimeout);
		entryID=pMibDialPlanTbl->DialPlanNumber;
		
		LIST_FOREACH(pDialPlanTblEntry, &pMibDialPlanTbl->head, entries)
		{
			VOICE_WRAPPER(omci_voice_dial_plan_set, chid,pDialPlanTblEntry->tableEntry.dpToken, 
				MIB_TABLE_DIALPLANTABLE_TOKEN_LEN, entryID, pMibDialPlanTbl->DialPlanNumber);
			entryID--;
		}
	}
}
void auth_sec_method(UINT16 chid, UINT16 UsernamePassword){
	// Authentication security method 9.12.4
	MIB_TABLE_AUTH_SEC_METHOD_T                 tmpMibAuthSecMethod, *pMibAuthSecMethod=NULL;
	UINT32 proxy = 0; // Backup proxy is optional in G.988
	
	tmpMibAuthSecMethod.EntityId = UsernamePassword;

	if (FALSE == mib_FindEntry(MIB_TABLE_AUTH_SEC_METHOD_INDEX , &tmpMibAuthSecMethod, &pMibAuthSecMethod)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Auth sec method Entry not found %u\n" , tmpMibAuthSecMethod.EntityId);
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Auth sec method Entry found %u\n" , tmpMibAuthSecMethod.EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Username=%s Password=%s \n" , pMibAuthSecMethod->Username1, pMibAuthSecMethod->Password);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Username2=%s \n" , pMibAuthSecMethod->Username2);
		VOICE_WRAPPER(omci_voice_user_name_set, chid, proxy,
		              pMibAuthSecMethod->Username1, pMibAuthSecMethod->Username2,MIB_TABLE_AUTH_SEC_METHOD_USERNAME1_LEN);					
		VOICE_WRAPPER(omci_voice_password_set, chid, proxy,
		              pMibAuthSecMethod->Password, MIB_TABLE_AUTH_SEC_METHOD_PASSWORD_LEN);

	}	
}
void conference_factory_URI(UINT16 chid, UINT16 ConferenceFactoryURIPointer){
	// Large string 9.12.5  for common use
	MIB_TABLE_LARGE_STRING_T                    tmpMibLargeString, *pMibLargeString=NULL;
	// Network address 9.12.3  for common use
	MIB_TABLE_NETWORK_ADDR_T                    tmpMibNetworkAddr, *pMibNetworkAddr=NULL;
	char *lstr_ptr = NULL;
	UINT32 i;
	
	tmpMibNetworkAddr.EntityId = ConferenceFactoryURIPointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_NETWORK_ADDR_INDEX, &tmpMibNetworkAddr, &pMibNetworkAddr)){
	    OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry not found\n");
	}
	else
	{
	    OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry found,EntityId=%u\n", pMibNetworkAddr->EntityId);
	    OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecurityPtr=%u\n", pMibNetworkAddr->SecurityPtr);
	    OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"AddrPtr=0x%02x\n", pMibNetworkAddr->AddrPtr);
	    tmpMibLargeString.EntityId = pMibNetworkAddr->AddrPtr;
	    if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
	        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
	    }
	    else
	    {
	        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
	        OMCI_LOG(OMCI_VOIP_DBG_LEVEL," NumOfParts=%u\n", pMibLargeString->NumOfParts);

	        for (i = 0, lstr_ptr=pMibLargeString->Part1; i < pMibLargeString->NumOfParts; i++, lstr_ptr += MIB_TABLE_LARGE_STRING_PART_LEN+1)
	        {
	            OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"%s\n" , lstr_ptr);
	            //TBD
	        }
	    }
	}	
}
void bridged_line_agent_URI(UINT16 chid, UINT16 BridgedLineAgentURIPointer){
	// Large string 9.12.5  for common use
	MIB_TABLE_LARGE_STRING_T                    tmpMibLargeString, *pMibLargeString=NULL;
	// Network address 9.12.3  for common use
	MIB_TABLE_NETWORK_ADDR_T                    tmpMibNetworkAddr, *pMibNetworkAddr=NULL;
	char *lstr_ptr = NULL;
	UINT32 i;
	
	tmpMibNetworkAddr.EntityId = BridgedLineAgentURIPointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_NETWORK_ADDR_INDEX, &tmpMibNetworkAddr, &pMibNetworkAddr)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry not found\n");
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry found,EntityId=%u\n", pMibNetworkAddr->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecurityPtr=%u\n", pMibNetworkAddr->SecurityPtr);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"AddrPtr=0x%02x\n", pMibNetworkAddr->AddrPtr);

		tmpMibLargeString.EntityId = pMibNetworkAddr->AddrPtr;
		if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
		}
		else
		{
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%d\n", pMibLargeString->EntityId);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);

			for (i = 0, lstr_ptr=pMibLargeString->Part1; i < pMibLargeString->NumOfParts; i++, lstr_ptr += MIB_TABLE_LARGE_STRING_PART_LEN+1)
			{
				OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"%s\n" , lstr_ptr);
				//TBD
			}
		}
	}	
}
void direct_connect_URI(UINT16 chid, UINT16 DirectConnectURIPointer){
	// Large string 9.12.5  for common use
	MIB_TABLE_LARGE_STRING_T                    tmpMibLargeString, *pMibLargeString=NULL;
	// Network address 9.12.3  for common use
	MIB_TABLE_NETWORK_ADDR_T                    tmpMibNetworkAddr, *pMibNetworkAddr=NULL;
	char *lstr_ptr = NULL;
	UINT32 i;
	
	tmpMibNetworkAddr.EntityId = DirectConnectURIPointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_NETWORK_ADDR_INDEX, &tmpMibNetworkAddr, &pMibNetworkAddr)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry not found\n");
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry found, EntityId=%u\n", pMibNetworkAddr->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecurityPtr=%u\n", pMibNetworkAddr->SecurityPtr);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"AddrPtr=0x%02x\n", pMibNetworkAddr->AddrPtr);

		tmpMibLargeString.EntityId = pMibNetworkAddr->AddrPtr;
		if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
		}			
		else
		{
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL," NumOfParts=%u\n", pMibLargeString->NumOfParts);
			for (i = 0, lstr_ptr=pMibLargeString->Part1 ; i<pMibLargeString->NumOfParts ; i++ , lstr_ptr += MIB_TABLE_LARGE_STRING_PART_LEN+1)
			{
				OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"%s\n" , lstr_ptr);
				//TBD
			}
		}
	}	
}
void voip_application_service_profile(UINT16 chid, UINT16 ApplicationServicesProfilePointer){
	// VoIP application service profile 9.9.8
	MIB_TABLE_VOIPAPPLICATIONSERVICEPROFILE_T   tmpMibVoipApplicationServiceProfile, *pMibVoipApplicationServiceProfile=NULL;

	
	tmpMibVoipApplicationServiceProfile.EntityId = ApplicationServicesProfilePointer;		
	if (FALSE == mib_FindEntry(MIB_TABLE_VOIPAPPLICATIONSERVICEPROFILE_INDEX, &tmpMibVoipApplicationServiceProfile, &pMibVoipApplicationServiceProfile)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoIP application service profile not found EntityId=%u\n", tmpMibVoipApplicationServiceProfile.EntityId);
	}		
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoIP application service profile found, EntityId=%u\n", tmpMibVoipApplicationServiceProfile.EntityId);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CIDFeatures=%u\n" , pMibVoipApplicationServiceProfile->CIDFeatures);
		VOICE_WRAPPER(omci_voice_CID_feature_set, chid, pMibVoipApplicationServiceProfile->CIDFeatures);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CallWaitingFeatures=%u\n" , pMibVoipApplicationServiceProfile->CallWaitingFeatures);
		VOICE_WRAPPER(omci_voice_call_wait_feature_set, chid, pMibVoipApplicationServiceProfile->CallWaitingFeatures);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CallProgressOrTransferFeatures=%u\n" , pMibVoipApplicationServiceProfile->CallProgressOrTransferFeatures);
		VOICE_WRAPPER(omci_voice_progress_or_transfer_feature_set, chid, pMibVoipApplicationServiceProfile->CallProgressOrTransferFeatures);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CallPresentationFeatures=%u\n" , pMibVoipApplicationServiceProfile->CallPresentationFeatures);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DirectConnectFeature=%u\n" , pMibVoipApplicationServiceProfile->DirectConnectFeature);
		VOICE_WRAPPER(omci_voice_direct_connect_feature_set, chid, pMibVoipApplicationServiceProfile->DirectConnectFeature);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DirectConnectURIPointer=%u\n" , pMibVoipApplicationServiceProfile->DirectConnectURIPointer);
		direct_connect_URI(chid, pMibVoipApplicationServiceProfile->DirectConnectURIPointer);


		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"BridgedLineAgentURIPointer=%u\n" , pMibVoipApplicationServiceProfile->BridgedLineAgentURIPointer);
		bridged_line_agent_URI(chid,pMibVoipApplicationServiceProfile->BridgedLineAgentURIPointer);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"ConferenceFactoryURIPointer=%u\n" , pMibVoipApplicationServiceProfile->ConferenceFactoryURIPointer);
		conference_factory_URI(chid, pMibVoipApplicationServiceProfile->ConferenceFactoryURIPointer);

	}	

}
void voip_feature_access_codes(UINT16 chid, UINT16 FeatureCodePointer){
	// VoIP feature access codes 9.9.9
	MIB_TABLE_VOIPFEATUREACCESSCODES_T          tmpMibVoipFeatureAccessCodes, *pMibVoipFeatureAccessCodes=NULL;
	
	tmpMibVoipFeatureAccessCodes.EntityId = FeatureCodePointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_VOIPFEATUREACCESSCODES_INDEX, &tmpMibVoipFeatureAccessCodes, &pMibVoipFeatureAccessCodes)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoIP feature access codes not found EntityId=%u\n" , tmpMibVoipFeatureAccessCodes.EntityId);
	}		
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoIP feaute access codes found, EntityId=%u\n" , tmpMibVoipFeatureAccessCodes.EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CancelCallWaiting=%s\n", pMibVoipFeatureAccessCodes->CancelCallWaiting);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CancelHold=%s\n", pMibVoipFeatureAccessCodes->CancelHold);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CancelPark=%s\n", pMibVoipFeatureAccessCodes->CancelPark);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CancelIDActivate=%s\n", pMibVoipFeatureAccessCodes->CancelIDActivate);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CancelIDdeactivate=%s\n", pMibVoipFeatureAccessCodes->CancelIDdeactivate);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DoNotDisturbActivate=%s\n", pMibVoipFeatureAccessCodes->DoNotDisturbActivate);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DoNotDisturbDeactivate=%s\n", pMibVoipFeatureAccessCodes->DoNotDisturbDeactivate);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DoNotDisturbPINChange=%s\n", pMibVoipFeatureAccessCodes->DoNotDisturbPINChange);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"EmergencyServiceNumber=%s\n", pMibVoipFeatureAccessCodes->EmergencyServiceNumber);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IntercomService=%s\n", pMibVoipFeatureAccessCodes->IntercomService);
	}	

}
void sip_agent_config_data(UINT16 chid, UINT16 SIPAgentPointer){
	// SIP Agent config data 9.9.3
	MIB_TABLE_SIPAGENTCONFIGDATA_T              mibSipAgentCfgData;
	// Large string 9.12.5  for common use
	MIB_TABLE_LARGE_STRING_T                    tmpMibLargeString, *pMibLargeString=NULL;
	// Network address 9.12.3  for common use
	MIB_TABLE_NETWORK_ADDR_T                    tmpMibNetworkAddr, *pMibNetworkAddr=NULL;
	// TCP/UDP config data 9.4.3 for common use
	MIB_TABLE_TCP_UDP_CFG_DATA_T                tmpMibTcpUdpCfgData, *pMibTcpUdpCfgData=NULL;
	// IP host config data 9.4.1
	MIB_TABLE_IP_HOST_CFG_DATA_T                tmpMibIpHostCfgData, *pMibIpHostCfgData=NULL;
	UINT32 proxy = 0; // Backup proxy is optional in G.988	
	
	mibSipAgentCfgData.EntityId = SIPAgentPointer;
	
        if (GOS_OK != MIB_Get(MIB_TABLE_SIPAGENTCONFIGDATA_INDEX, &mibSipAgentCfgData, sizeof(MIB_TABLE_SIPAGENTCONFIGDATA_T)))
            return;


	// ProxyServerAddressPointer
	tmpMibLargeString.EntityId = mibSipAgentCfgData.ProxyServerAddressPointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);
		VOICE_WRAPPER(omci_voice_proxy_server_ip_set, chid, proxy,
			pMibLargeString->Part1, pMibLargeString->NumOfParts, MIB_TABLE_LARGE_STRING_PART_LEN);				
	}


	// OutboundProxyAddressPointer
	tmpMibLargeString.EntityId = mibSipAgentCfgData.OutboundProxyAddressPointer;
	if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
	}		
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);
		VOICE_WRAPPER(omci_voice_outbound_proxy_ip_set, chid, proxy,
			pMibLargeString->Part1, pMibLargeString->NumOfParts, MIB_TABLE_LARGE_STRING_PART_LEN);
	}


	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPRegExpTime=%u\n", mibSipAgentCfgData.SIPRegExpTime);
	VOICE_WRAPPER(omci_voice_sip_reg_exp_time_set, chid, proxy, mibSipAgentCfgData.SIPRegExpTime);			
	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPReregHeadStartTime=%u\n" , mibSipAgentCfgData.SIPReregHeadStartTime);
	VOICE_WRAPPER(omci_voice_reg_head_start_time_set, chid, proxy, mibSipAgentCfgData.SIPReregHeadStartTime);



	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPRegistrar=0x%02x\n" , mibSipAgentCfgData.SIPRegistrar);
	tmpMibNetworkAddr.EntityId = mibSipAgentCfgData.SIPRegistrar;
	if (FALSE == mib_FindEntry(MIB_TABLE_NETWORK_ADDR_INDEX, &tmpMibNetworkAddr, &pMibNetworkAddr)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry not found\n");
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Network address entry found, EntityId=%u\n", pMibNetworkAddr->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecurityPtr=%u\n", pMibNetworkAddr->SecurityPtr);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"AddrPtr=0x%02x\n", pMibNetworkAddr->AddrPtr);

		tmpMibLargeString.EntityId = pMibNetworkAddr->AddrPtr;
		if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry not found\n");
		}
		else
		{
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);
			VOICE_WRAPPER(omci_voice_SIPRegistrar_set, chid, proxy,
				pMibLargeString->Part1, pMibLargeString->NumOfParts, MIB_TABLE_LARGE_STRING_PART_LEN);
		}
	}


	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"TCPUDPPointer=%u\n" , mibSipAgentCfgData.TCPUDPPointer);
	tmpMibTcpUdpCfgData.EntityId = mibSipAgentCfgData.TCPUDPPointer;			
	if (FALSE == mib_FindEntry(MIB_TABLE_TCP_UDP_CFG_DATA_INDEX , &tmpMibTcpUdpCfgData, &pMibTcpUdpCfgData)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"TCP/UDP config data not found. EntityId=%u\n", tmpMibTcpUdpCfgData.EntityId);
	}	
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"TCP/UDP config data found %u\n" , tmpMibTcpUdpCfgData.EntityId);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PortId=%u\n" , pMibTcpUdpCfgData->PortId);
		VOICE_WRAPPER(omci_voice_proxy_tcp_udp_port_set, chid, proxy, pMibTcpUdpCfgData->PortId);

		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Protocol=%u\n" , pMibTcpUdpCfgData->Protocol);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"TosDiffserv=%u\n" , pMibTcpUdpCfgData->TosDiffserv);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IpHostPointer=%u\n" , pMibTcpUdpCfgData->IpHostPointer);
		
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IpHostPointer=%u\n" , pMibTcpUdpCfgData->IpHostPointer);
		tmpMibIpHostCfgData.EntityID = pMibTcpUdpCfgData->IpHostPointer;
		if (FALSE == mib_FindEntry(MIB_TABLE_IP_HOST_CFG_DATA_INDEX, &tmpMibIpHostCfgData, &pMibIpHostCfgData)){
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IP host config data not found %u\n" , tmpMibIpHostCfgData.EntityID);
		}
		else
		{
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IP host config data found %u\n" , tmpMibIpHostCfgData.EntityID);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"EntityID=%u\n" , pMibIpHostCfgData->EntityID);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IpOptions=%u\n" , pMibIpHostCfgData->IpOptions);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"MacAddress=%s\n" , pMibIpHostCfgData->MacAddress);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"OnuIdentifier=%s\n" , pMibIpHostCfgData->OnuIdentifier);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"IpAddress=%u\n" , pMibIpHostCfgData->IpAddress);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Mask=%u\n" , pMibIpHostCfgData->Mask);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Gateway=%u\n" , pMibIpHostCfgData->Gateway);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PrimaryDns=%u\n" , pMibIpHostCfgData->PrimaryDns);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecondaryDns=%u\n" , pMibIpHostCfgData->SecondaryDns);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CurrentAddress=%u\n" , pMibIpHostCfgData->CurrentAddress);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CurrentMask=%u\n" , pMibIpHostCfgData->CurrentMask);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CurrentGateway=%u\n" , pMibIpHostCfgData->CurrentGateway);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CurrentPrimaryDns=%u\n" , pMibIpHostCfgData->CurrentPrimaryDns);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"CurrentSecondaryDns=%u\n" , pMibIpHostCfgData->CurrentSecondaryDns);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"DomainName=%s\n" , pMibIpHostCfgData->DomainName);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"HostName=%s\n" , pMibIpHostCfgData->HostName);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"RelayAgentOptions=%u\n" , pMibIpHostCfgData->RelayAgentOptions);
		}
	}

        // HostPartURI
        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"HostPartURI=%u\n", mibSipAgentCfgData.HostPartURI);
        tmpMibLargeString.EntityId = mibSipAgentCfgData.HostPartURI;
        if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString))
        {
            OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIP domain is null\n");				
        }
        else
        {
            OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large String Entry found, EntityId=%u\n", pMibLargeString->EntityId);
            OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);
            VOICE_WRAPPER(omci_voice_proxy_domain_name_set, chid, proxy,
                          pMibLargeString->Part1, pMibLargeString->NumOfParts, MIB_TABLE_LARGE_STRING_PART_LEN);				
        }

        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PrimarySIPDNS=%u\n", mibSipAgentCfgData.PrimarySIPDNS);
        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SecondarySIPDNS=%u\n", mibSipAgentCfgData.SecondarySIPDNS);
        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPStatus=%u\n", mibSipAgentCfgData.SIPStatus);
        OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Softswitch=%s\n" , mibSipAgentCfgData.Softswitch);			
}
void user_part_AOR(UINT16 chid, UINT16 UserPartAOR){
	// Large string 9.12.5  for common use
	MIB_TABLE_LARGE_STRING_T                    tmpMibLargeString, *pMibLargeString=NULL;
	UINT32 proxy = 0; // Backup proxy is optional in G.988
	
	tmpMibLargeString.EntityId = UserPartAOR;
	if (FALSE == mib_FindEntry(MIB_TABLE_LARGE_STRING_INDEX, &tmpMibLargeString, &pMibLargeString)){
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large string entry not found\n");
	}
	else
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"Large string entry found, EntityId=%u\n", pMibLargeString->EntityId);
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NumOfParts=%u\n", pMibLargeString->NumOfParts);
		VOICE_WRAPPER(omci_voice_user_part_aor_set, chid, proxy,
			pMibLargeString->Part1, pMibLargeString->NumOfParts, MIB_TABLE_LARGE_STRING_PART_LEN);
	}	
}
GOS_ERROR_CODE pptp_pots_uni(UINT16 *chid, UINT16   PPTPPointer){
	// POTS UNI 9.9.1
	MIB_TABLE_POTSUNI_T                         mibPotsUni;
	
	mibPotsUni.EntityId = PPTPPointer;
	if (GOS_OK != MIB_Get(MIB_TABLE_POTSUNI_INDEX, &mibPotsUni, sizeof(MIB_TABLE_POTSUNI_T)))
		return GOS_FAIL;

	omci_get_channel_index_by_pots_uni_me_id(mibPotsUni.EntityId, chid);
	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"chid=%u\n" , *chid);
	if (*chid > gInfo.devCapabilities.potsPortNum)
	{
		OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"%s(%d) channel number %u out of range\n" , __FUNCTION__ , __LINE__ , *chid);
		return GOS_FAIL;
	}
	
	VOICE_WRAPPER(omci_voice_pots_state_set, *chid, mibPotsUni.AdminState);
	return GOS_OK;
}
GOS_ERROR_CODE omci_voice_service_handler(void  *pObj)
{
	// VoIP config data 9.9.18
	MIB_TABLE_VOIPCONFIGDATA_T                  mibVoipCfgData;
	// SIP user data 9.9.2
	MIB_TABLE_SIPUSERDATA_T                     mibSipUserData;
	// VoIP voice CTP 9.9.4
	MIB_TABLE_VOIPVOICECTP_T                    mibVoIpVoiceCtp, *ptr = NULL;
	UINT32 proxy = 0; // Backup proxy is optional in G.988
	UINT16 chid;
	UINT32 voip_ctp_cnt = 0, count =0;
	UINT32 sip_user_data_cnt = 0;
	BOOL do_voice_service = FALSE;


	ptr = (MIB_TABLE_VOIPVOICECTP_T  *)pObj;

	mibVoipCfgData.EntityId = 0;
	if (GOS_OK != MIB_Get(MIB_TABLE_VOIPCONFIGDATA_INDEX, &mibVoipCfgData, sizeof(MIB_TABLE_VOIPCONFIGDATA_T)))
		return GOS_ERR_DISABLE;

	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VOIPConfigurationMethodUsed=%u\n" , mibVoipCfgData.VOIPConfigurationMethodUsed);
	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SignallingProtocolUsed=%u\n" , mibVoipCfgData.SignallingProtocolUsed);
	
	if (VCD_SIG_PROTOCOL_USED_SIP != mibVoipCfgData.SignallingProtocolUsed)
		return GOS_OK;

	if (VCD_CFG_METHOD_USED_TR069 == mibVoipCfgData.VOIPConfigurationMethodUsed)
		return GOS_OK;
	
	VOICE_WRAPPER(omci_voice_config_update);
	
	if ((0 != (voip_ctp_cnt = MIB_GetTableCurEntryCount(MIB_TABLE_VOIPVOICECTP_INDEX)))&&
		(GOS_OK == MIB_GetFirst(MIB_TABLE_VOIPVOICECTP_INDEX, &mibVoIpVoiceCtp, sizeof(MIB_TABLE_VOIPVOICECTP_T))))
	{

		while (count < voip_ctp_cnt)
		{
			count++;
			if (ptr && ptr->EntityId != mibVoIpVoiceCtp.EntityId)
			{
				goto next_voip_ctp;
			}
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"entity_id=%u\n" , mibVoIpVoiceCtp.EntityId);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PPTPPointer=%u\n" , mibVoIpVoiceCtp.PPTPPointer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VOIPMediaProfilePointer=%u\n" , mibVoIpVoiceCtp.VOIPMediaProfilePointer);
			
	        	if (GOS_OK != pptp_pots_uni(&chid, mibVoIpVoiceCtp.PPTPPointer))
	        		goto next_voip_ctp;
				
			voip_media_profile(chid, mibVoIpVoiceCtp.VOIPMediaProfilePointer);
			do_voice_service = TRUE;
	    next_voip_ctp:
			if (GOS_OK != (MIB_GetNext(MIB_TABLE_VOIPVOICECTP_INDEX, &mibVoIpVoiceCtp, sizeof(MIB_TABLE_VOIPVOICECTP_T)))){
				OMCI_LOG(OMCI_LOG_LEVEL_DBG,"get next fail,count=%d",count);
			}
		}
    	}
	count=0;	
	if ((0 != (sip_user_data_cnt = MIB_GetTableCurEntryCount(MIB_TABLE_SIPUSERDATA_INDEX)))&&
		(GOS_OK == MIB_GetFirst(MIB_TABLE_SIPUSERDATA_INDEX, &mibSipUserData, sizeof(MIB_TABLE_SIPUSERDATA_T))))
	{
		while (count < sip_user_data_cnt)
		{
			count++;
	        	OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"sip user data  EntityId=%u\n", mibSipUserData.EntityId);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"PPTPPointer=%u\n",  mibSipUserData.PPTPPointer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"UserPartAOR=%u\n" , mibSipUserData.UserPartAOR);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPDisplayName=%s\n" , mibSipUserData.SIPDisplayName);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"NetworkDialPlanPointer=%u\n", mibSipUserData.NetworkDialPlanPointer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"UsernamePassword=%u\n", mibSipUserData.UsernamePassword);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"ApplicationServicesProfilePointer=%u\n", mibSipUserData.ApplicationServicesProfilePointer);	
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"FeatureCodePointer=%u\n", mibSipUserData.FeatureCodePointer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoicemailServerSIPURI=%u\n", mibSipUserData.VoicemailServerSIPURI);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"VoicemailSubscriptionExpirationTime=%u\n", mibSipUserData.VoicemailSubscriptionExpirationTime);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"ReleaseTimer=%u\n", mibSipUserData.ReleaseTimer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"ROHTimer=%u\n", mibSipUserData.ROHTimer);
			OMCI_LOG(OMCI_VOIP_DBG_LEVEL,"SIPAgentPointer=%u\n", mibSipUserData.SIPAgentPointer);
			
	        	if (GOS_OK != pptp_pots_uni(&chid, mibSipUserData.PPTPPointer))
	        		goto next_sip_user_data;
				
			user_part_AOR(chid, mibSipUserData.UserPartAOR);
			VOICE_WRAPPER(omci_voice_sip_display_name_set, chid, proxy,mibSipUserData.SIPDisplayName, MIB_TABLE_SIPDISPLAYNAME_LEN);
			network_dial_plan( chid, mibSipUserData.NetworkDialPlanPointer);			
			auth_sec_method(chid,mibSipUserData.UsernamePassword);
			voip_application_service_profile(chid,mibSipUserData.ApplicationServicesProfilePointer);
			voip_feature_access_codes(chid, mibSipUserData.FeatureCodePointer);
			sip_agent_config_data(chid, mibSipUserData.SIPAgentPointer);
			do_voice_service = TRUE;
		next_sip_user_data:
			if (GOS_OK != (MIB_GetNext(MIB_TABLE_SIPUSERDATA_INDEX, &mibSipUserData, sizeof(MIB_TABLE_SIPUSERDATA_T))))
				OMCI_LOG(OMCI_LOG_LEVEL_DBG,"MIB_TABLE_SIPUSERDATA_INDEX get next fail,count=%d",count);
		}
	}
	if (do_voice_service)
	{
	    VOICE_WRAPPER(omci_voice_config_save);
	    VOICE_WRAPPER(omci_voice_service_restart);
	}
	return GOS_OK;
}
